const AbstractModel = require('./abstract.model');
const Sequelize = require('sequelize');

class UserModel extends AbstractModel {
    constructor() {
        super('sys_user', {
            "user_id": Sequelize.INTEGER,
            "login_name": Sequelize.STRING,
            "password": Sequelize.STRING,
            "login_count": Sequelize.INTEGER,
            "state": Sequelize.STRING,
            "last_login_time": Sequelize.DATE,
            "last_login_ip": Sequelize.STRING,
            "create_user": Sequelize.INTEGER,
            "create_time": Sequelize.DATE,
            "update_user": Sequelize.INTEGER,
            "update_time": Sequelize.DATE
        });
    }
    queryUserObject(where) {
        return this.model.findOne({ where });
    }

}


module.exports = global.buildClass(UserModel);